<template>
	<view class="news_detail">
		<news-head :item="newsData"></news-head>
		<!-- <news-swiper></news-swiper> -->
		<u-parse class="content" v-if="newsData.content" :html="newsData.content"></u-parse>
	</view>
</template>

<script>
	import NewsHead from "./components/NewsHead.vue"
	import NewsSwiper from "./components/NewsSwiper.vue"
	export default {
		components: {
			NewsHead,
			NewsSwiper
		},
		data() {
			let userCode = this.store_user_code
			return {
				queryObj: {
					newsCode: "",
					userCode
				},
				newsData: {}
			};
		},
		onLoad(option) {
			this.queryObj.newsCode = option.newsCode;
		},
		onShow() {
			this.queryObj.userCode = this.$store.state.user.store_user_code;
			this.loadData();
		},
		methods: {
			async loadData() {
				const result = await this.$api.getNewsByCode(this.queryObj);
				if (result.resultCode === '200' && result.data.data) {
					this.newsData = result.data.data;
				}
			},
		
		},
	}
</script>

<style lang="scss" scoped>
	@import "@/commom/styles/icons.css";

	page {
		background: #ffff;
	}

	.news_detail {
		.content {
			padding: 20rpx !important;
			padding-top: 0rpx;
			max-width: 100% !important;
			/deep/img{
				max-width: 710rpx !important;
				margin: 0 auto;
			}
			/deep/p{
				max-width: 710rpx !important;
				margin: 0 auto;
			}
			/deep/div{
				max-width: 710rpx !important;
				margin: 0 auto;
			}
		}

	}
</style>
